<?
include "../config/constants.php";

if( $_GET[_test] ){
	$_POST[XML] = file_get_contents(TEST_CRSS);
}

if( !$_POST[XML] ){
	echo "ERROR";
	exit;
}

$xml = new DOMDocument;
$xml->loadXML(stripslashes($_POST[XML]));
//echo stripslashes($_POST[XML]);

$xsl = new DOMDocument;
$xsl->loadXML(file_get_contents(FORMATTER_XSL_URL));
//echo file_get_contents(FORMATTER_XSL_URL);

// Configure the transformer
$proc = new XSLTProcessor;
$proc->importStyleSheet($xsl); // attach the xsl rules

echo $proc->transformToXML($xml);

?>
